package com.bkgy.controller.shutdowndetails.controller;


import com.bkgy.controller.shutdowndetails.entity.*;
import com.bkgy.controller.shutdowndetails.entity.dto.TbDowntimeTcm2280Dto;
import com.bkgy.controller.shutdowndetails.service.ShutdownService;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/shutdown")
public class ShutdownController {

    @Autowired
    private ShutdownService shutdownService;

    @Operation(summary = "1630连退停机记录",description = "1630连退停机记录")
    @PostMapping("/getTbDowntimeCal1630")
    public ResultData getTbDowntimeCal1630(@RequestBody @Valid tbDowntimeCal1630 request) {
        return shutdownService.getTbDowntimeCal1630_page(request);
    }

    @Operation(summary = "2150连退停机记录",description = "2150连退停机记录")
    @PostMapping("/getTbDowntimeCal2150")
    public ResultData getTbDowntimeCal2150(@RequestBody @Valid tbDowntimeCal2150 request) {
        return shutdownService.getTbDowntimeCal2150_page(request);
    }

    @Operation(summary = "1870镀锌停机记录",description = "1870镀锌停机记录")
    @PostMapping("/getTbDowntimeCgl1870")
    public ResultData getTbDowntimeCgl1870(@RequestBody @Valid tbDowntimeCgl1870 request) {
        return shutdownService.getTbDowntimeCgl1870_page(request);
    }

    @Operation(summary = "2280酸轧停机记录",description = "2280酸轧停机记录")
    @PostMapping("/getTbDowntimeTcm2280")
    public ResultData getTbDowntimeTcm2280(@RequestBody @Valid TbDowntimeTcm2280Dto request) {
        return shutdownService.getTbDowntimeTcm2280_page(request);
    }

    @Operation(summary = "1630连退停机记录-客户录入功能",description = "1630连退停机记录-客户录入功能")
    @PostMapping("/updateTbDowntimeCal1630")
    public ResultData updateTbDowntimeCal1630(@RequestBody @Valid tbDowntimeCal1630 request) {
        return shutdownService.updateTbDowntimeCal1630(request);
    }

    @Operation(summary = "2150连退停机记录-客户录入功能",description = "2150连退停机记录-客户录入功能")
    @PostMapping("/updateTbDowntimeCal2150")
    public ResultData updateTbDowntimeCal2150(@RequestBody @Valid tbDowntimeCal2150 request) {
        return shutdownService.updateTbDowntimeCal2150(request);
    }

    @Operation(summary = "1870镀锌停机记录-客户录入功能",description = "1870镀锌停机记录-客户录入功能")
    @PostMapping("/updateTbDowntimeCgl1870")
    public ResultData updateTbDowntimeCgl1870(@RequestBody @Valid tbDowntimeCgl1870 request) {
        return shutdownService.updateTbDowntimeCgl1870(request);
    }

    @Operation(summary = "2280酸轧停机记录-客户录入功能",description = "2280酸轧停机记录-客户录入功能")
    @PostMapping("/updateTbDowntimeTcm2280")
    public ResultData updateTbDowntimeTcm2280(@RequestBody @Valid TbDowntimeTcm2280Dto request) {
        return shutdownService.updateTbDowntimeTcm2280(request);
    }


    @Operation(summary = "近12个月轧机停机-各类停机原因-TCM2280",description = "近12个月轧机停机-各类停机原因-TCM2280")
    @PostMapping("/tbDowntimeTcm2280stops")
    public ResultData tbDowntimeTcm2280_stops(@RequestBody @Valid tbDowntime request) {
        return shutdownService.tbDowntimeTcm2280_stops(request);
    }

    @Operation(summary = "近12个月轧机停机-各类停机原因-CGL1870",description = "近12个月轧机停机-各类停机原因-CGL1870")
    @PostMapping("/tbDowntimeCgl1870stops")
    public ResultData tbDowntimeCgl1870_stops(@RequestBody @Valid tbDowntime request) {
        return shutdownService.tbDowntimeCgl1870_stops(request);
    }

    @Operation(summary = "近12个月轧机停机-各类停机原因-CAL1630",description = "近12个月轧机停机-各类停机原因-CAL1630")
    @PostMapping("/tbDowntimeCal1630stops")
    public ResultData tbDowntimeCal1630_stops(@RequestBody @Valid tbDowntime request) {
        return shutdownService.tbDowntimeCal1630_stops(request);
    }

    @Operation(summary = "近12个月轧机停机-各类停机原因-CAL2150",description = "近12个月轧机停机-各类停机原因-CAL2150")
    @PostMapping("/tbDowntimeCal2150stops")
    public ResultData tbDowntimeCal2150_stops(@RequestBody @Valid tbDowntime request) {
        return shutdownService.tbDowntimeCal2150_stops(request);
    }


    @Operation(summary = "近12月各班组轧机停机次数-TCM2280",description = "近12月各班组轧机停机次数-TCM2280")
    @PostMapping("/tbDowntimeTcm2280crew")
    public ResultData tbDowntimeTcm2280_crew(@RequestBody @Valid tbDownCrew request) {
        return shutdownService.tbDowntimeTcm2280_crew(request);
    }

    @Operation(summary = "近12月各班组轧机停机次数-CGL1870",description = "近12月各班组轧机停机次数-CGL1870")
    @PostMapping("/tbDowntimeCgl1870crew")
    public ResultData tbDowntimeCgl1870_crew(@RequestBody @Valid tbDownCrew request) {
        return shutdownService.tbDowntimeCgl1870_crew(request);
    }

    @Operation(summary = "近12月各班组轧机停机次数-CAL1630",description = "近12月各班组轧机停机次数-CAL1630")
    @PostMapping("/tbDowntimeCal1630crew")
    public ResultData tbDowntimeCal1630_crew(@RequestBody @Valid tbDownCrew request) {
        return shutdownService.tbDowntimeCal1630_crew(request);
    }

    @Operation(summary = "近12月各班组轧机停机次数-CAL2150",description = "近12月各班组轧机停机次数-CAL2150")
    @PostMapping("/tbDowntimeCal2150crew")
    public ResultData tbDowntimeCal2150_crew(@RequestBody @Valid tbDownCrew request) {
        return shutdownService.tbDowntimeCal2150_crew(request);
    }



    @Operation(summary = "近12月标准/日历作业率-TCM2280",description = "近12月标准/日历作业率-TCM2280")
    @PostMapping("/tbDowntimeTcm2280rate")
    public ResultData tbDowntimeTcm2280_rate(@RequestBody @Valid tbDownRate request) {
        return shutdownService.tbDowntimeTcm2280_rate(request);
    }

    @Operation(summary = "近12月标准/日历作业率-CGL1870",description = "近12月标准/日历作业率-CGL1870")
    @PostMapping("/tbDowntimeCgl1870rate")
    public ResultData tbDowntimeCgl1870_rate(@RequestBody @Valid tbDownRate request) {
        return shutdownService.tbDowntimeCgl1870_rate(request);
    }

    @Operation(summary = "近12月标准/日历作业率-CAL1630",description = "近12月标准/日历作业率-CAL1630")
    @PostMapping("/tbDowntimeCal1630rate")
    public ResultData tbDowntimeCal1630_rate(@RequestBody @Valid tbDownRate request) {
        return shutdownService.tbDowntimeCal1630_rate(request);
    }

    @Operation(summary = "近12月标准/日历作业率-CAL2150",description = "近12月标准/日历作业率-CAL2150")
    @PostMapping("/tbDowntimeCal2150rate")
    public ResultData tbDowntimeCal2150_rate(@RequestBody @Valid tbDownRate request) {
        return shutdownService.tbDowntimeCal2150_rate(request);
    }




    @Operation(summary = "停机记录计划表-增加",description = "停机记录计划表-增加")
    @PostMapping("/tbDowntimePlanadd")
    public ResultData tbDowntimePlan_add(@RequestBody @Valid tbDowntimePlan request) {
        return shutdownService.tbDowntimePlan_add(request);
    }

    @Operation(summary = "停机记录计划表-修改",description = "停机记录计划表-修改")
    @PostMapping("/tbDowntimePlanupdate")
    public ResultData tbDowntimePlan_update(@RequestBody @Valid tbDowntimePlan request) {
        return shutdownService.tbDowntimePlan_update(request);
    }

    @Operation(summary = "停机记录计划表-删除",description = "停机记录计划表-删除")
    @PostMapping("/tbDowntimePlandel")
    public ResultData tbDowntimePlan_del(@RequestBody @Valid tbDowntimePlan request) {
        return shutdownService.tbDowntimePlan_del(request);
    }

    @Operation(summary = "停机记录计划表-查询",description = "停机记录计划表-查询")
    @PostMapping("/tbDowntimePlanquery")
    public ResultData tbDowntimePlan_query(@RequestBody @Valid tbDowntimePlan request) {
        return shutdownService.tbDowntimePlan_query(request);
    }
}
